<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="js/vue.js"></script>
</head>
<body>
        <div id="app">
                <button :disabled="targe"  @click="action">{{num}}</button>
        </div>
  
        <script>
            var app=new Vue({
                el:"#app",
                data:{
                    num:"点击",
                    targe:false
                },
                methods: {
                    action:function(){
                        this.num=10;
                        let time=setInterval(()=>{
                            if(this.num !== 0){
                                this.targe=true;
                              this.num--
                            }else{
                                this.num="点击"
                                this.targe=false;
                                clearInterval(time)
                            }
                        },1000)
                    } 
                        
                    
                },
                mounted () {
                    this.action()
                }
            })


        </script>



</body>
</html>